package com.ljx.ChaiFen;

import com.sun.jmx.snmp.SnmpNull;

/**
 * @author 李加喜
 * @Package com.ljx.ChaiFen
 * @date 2021-11-23 22:51
 */
// 1109 航班预定统计
public class HangBan {
    public static void main(String[] args) {

    }
    public int[] corpFlightBookings(int[][] bookings, int n) {
        int[] num=new int[n];
        Difference difference = new Difference(num);
        for (int[] book:bookings){
            //注意索引的下标要-1  这里是数组 0对应的是第一个
            int startIndex= book[0]-1;
            int endIndex= book[1]-1;
            int val=book[2];
            difference.increment(startIndex,endIndex,val);
        }
        return difference.result();
    }
}
